#import "LCAutoTrackManager.h"
#import "LCTrackQueue.h"
#import "UIControl+LCTrack.h"
#import "UIViewController+LCTrack.h"

@implementation LCAutoTrackManager

+ (instancetype)sharedManager {
    static LCAutoTrackManager *manager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[self alloc] init];
    });
    return manager;
}

+ (void)startTracking {
    [UIViewController lc_swizzleViewDidAppear];
    [UIControl lc_swizzleSendAction];
}

+ (void)trackEventWithName:(NSString *)name params:(NSDictionary *)params {
    LCTrackEvent *event = [[LCTrackEvent alloc] initWithName:name params:params];
    [[LCTrackQueue sharedQueue] enqueueEvent:event];
}

@end